package o;

import android.content.Context;
import com.huawei.hms.framework.network.grs.IQueryUrlsCallBack;
import java.util.Map;
import java.util.Map.Entry;

public abstract class dva implements eqm {
    private Context ˋ;
    private duz ॱ;

    class a implements IQueryUrlsCallBack {
        private eql ˋ;
        final /* synthetic */ dva ॱ;

        public a(dva o_dva, eql o_eql) {
            this.ॱ = o_dva;
            this.ˋ = o_eql;
        }

        public void onCallBackSuccess(Map<String, String> map) {
            if (CollectCheck.isEmpty((Map) map)) {
                Logger.e("AbstractServerGrsProcessor", "onCallBackSuccess but grs map returned is empty");
                this.ˋ.ˎ(1001);
                return;
            }
            this.ॱ.ˏ((Map) map);
            this.ˋ.ˋ();
        }

        public void onCallBackFail(int i) {
            Logger.e("AbstractServerGrsProcessor", "onCallBackFail code:" + i);
            this.ˋ.ˎ(i);
        }
    }

    public abstract String ˊ();

    public abstract String ˋ();

    public abstract int ˏ();

    public abstract void ॱ(Map<String, String> map);

    public dva(Context context) {
        this.ˋ = context;
        this.ॱ = new duz(context, ˋ());
    }

    public void ॱ(eql o_eql) {
        this.ॱ.ˊ(ˏ(o_eql), ˊ());
    }

    protected IQueryUrlsCallBack ˏ(eql o_eql) {
        return new a(this, o_eql);
    }

    public boolean ˎ() {
        Map ˎ = this.ॱ.ˎ(ˊ());
        if (!CollectCheck.isEmpty(ˎ)) {
            return ˏ(ˎ);
        }
        Logger.e("AbstractServerGrsProcessor", "getGrsUrls,but grs map returned is empty");
        return false;
    }

    protected boolean ˏ(Map<String, String> map) {
        if (map.size() < ˏ()) {
            Logger.ˋ("AbstractServerGrsProcessor", "doing initServerUrl,but grs map length is invalid");
        }
        Logger.ˏ("AbstractServerGrsProcessor", "will setServerAddr address for store/uc/mobile/jxs/aus");
        for (Entry entry : map.entrySet()) {
            Logger.ˏ("AbstractServerGrsProcessor", "initServerUrl for[" + ((String) entry.getKey()) + "]" + ((String) entry.getValue()));
        }
        ॱ((Map) map);
        return true;
    }

    public boolean ॱ() {
        return this.ॱ.ॱ();
    }
}
